package cn.edu.xmu.oomall.payment.util;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;

/**
 * @author 张浩山
 */
public class DateTimeTransformation {
    public static LocalDateTime getLocalDateTime(ZonedDateTime dataTime) {
        return dataTime.withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime();
    }

    public static ZonedDateTime getZonedDateTime(LocalDateTime dateTime) {
        return dateTime.atZone(ZoneId.systemDefault());
    }
}
